/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rad.Java.MotelPlus.Class;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import rad.Java.Common.Class.DefaultClass;
import rad.Java.Common.Class.IClass;

/**
 *
 * @author Renato ferreira dos santos
 */
public class Status extends DefaultClass implements IClass{
    // <editor-fold defaultstate="collapsed" desc="Declaration of variables">
        private String _name;
        private String _table;
    // </editor-fold>

    public Status()
    {
        _gsql.setTable("status");
        _sequence = "status_status_id_seq";
    }

    // <editor-fold defaultstate="collapsed" desc="Declaration of methods Get and Set">
        public String getName() {
            return _name;
        }

        public void setName(String _name) {
            this._name = _name;
        }

        public String getTable() {
            return _table;
        }

        public void setTable(String _table) {
            this._table = _table;
        }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Declaration of functions">
        public void clear() {
            _id                 = "";
            _name               = "";
            _table              = "";
        }

        @Override
        public void get(ResultSet rs) {
            try {
                _id                 = rs.getString("status_id");
                _name               = rs.getString("status_name");
                _table              = rs.getString("status_table");
            } catch (SQLException ex) {
                Logger.getLogger(Status.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        @Override
        public void setGsql() {
            _gsql.setValue( _id                 , "status_id");
            _gsql.setValue( _name               , "status_name");
            _gsql.setValue( _table              , "status_table");
        }
    // </editor-fold>
}
